package com.mcms.web;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; 

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import com.mcms.domain.User;
import com.mcms.service.UserService;

public class DeptManager extends AbstractCommandController {
	private UserService userService;

	public DeptManager() {
		setCommandClass(LoginCommand.class);
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	protected ModelAndView handle(HttpServletRequest request,
			HttpServletResponse response, Object command, BindException errors)
			throws Exception {
		
		/**参数获取*/
		String actionType = request.getParameter("actionType");// 控制跳转参数
		String userName = request.getParameter("userName");
		
		System.out.println("at:"+actionType+";un:"+userName);
		
		/**登陆页跳转*/
		if(actionType.equals("deptList")){
			return new ModelAndView("access/deptList");
		}
		
		
		
		/**默认跳转至登陆页面*/
		return new ModelAndView("login");

	}
}
